<meta http-equiv="content-type" content="text/html;charset=utf-8">
<html>
<head>

  <style>
    body {
      font-size: 13px;
    }

    .summary {
      padding: 10px 16px;
      margin-top: 6px;
      border: 1px solid #4CAF4F;
      border-radius: 10px;
    }

    .summary table td {
      border-bottom: 1px dotted #4D4D4D;
      padding: 6px 0;
    }

    table.bills {
      border: none;
      border-collapse: collapse;
    }

    .bills thead th {
      background-color: #D9D9D9;
      padding: 6px 10px;
    }

    .bills tbody td {
      border-bottom: 1px solid #C4C4C4;
      padding: 6px 10px;
    }
  </style>
</head>

<body>
<div class="row" style="margin-bottom: 24px;">
  <div class="column" style="width: 30%;float: left;">
    <div style="font-size: 18px; font-weight: bold">{{ .Agency.name}}</div>
    <div style="font-size: 14px; margin-top: 4px">{{.Agency.address}}</div>
    <div style="font-size: 14px; margin-top: 4px">Agency Code <b>{{.Agency.agency_code}}</b></div>
  </div>

  <div class="column" style="width: 50%; float: right;">


    <div style="font-weight: 500;font-size: 24px; color: #388E3B; text-align: right;">账单</div>
    <div class="summary">
      <table style="width: 100%;">
        <tr>
          <td colspan="2"><b>账户概况</b></td>
        </tr>
        <tr>
          <td>期初余额:</td>
          <td align="right">CNY {{.Agency.opening}}</td>
        </tr>
        <tr>
          <td>入账金额:</td>
          <td align="right">CNY {{.Agency.in}}</td>
        </tr>
        <tr>
          <td>出账金额:</td>
          <td align="right">CNY {{.Agency.out}}</td>
        </tr>
        <tr>
          <td>期末余额:</td>
          <td align="right">CNY {{.Agency.closed}}</td>
        </tr>
      </table>
    </div>
  </div>
</div>
<div style="font-weight: bold;font-size: 24px;line-height: 25px;width: 100%;float: left;margin-top: 30px;margin-bottom: 15px">{{.Agency.dates}}</div>
<table class="bills" style="width: 100%; margin-top: 16px">

  <thead>
  <tr>
    <th align="left" >时间</th>
    <th align="left" width="100">描述</th>
    <th>信息</th>
    <th align="right">入账</th>
    <th align="right">出账</th>
    <th align="right">余额</th>
  </tr>
  </thead>
  <tbody>
  {{range .AgencyBill}}
  <tr>
    <td align="left" style="padding-bottom: -6px;">{{.CreatedAt}}</td>
    <td align="left">{{.BillType}}</td>
    <td align="left">
      <text>{{.ReferenceId}}</text>
      <div style="height: 6px;"> </div>
      {{range .Tickets}}
      <text style="font-size: 12px;">{{.Segment}} {{.FlightNo}} {{.DepartureDate}} {{.TicketNo}} {{.Name}}</text>
      <div style="height: 3px;"> </div>
      {{end}}</td>
    <td align="right">
      {{.AmountIn}}
    </td>
    <td align="right">
      {{.AmountOut}}
    </td>
    <td align="right">
      {{.AfterAmount}}
    </td>
  </tr>
  {{end}}

  </tbody>
</table>
</body>

</html>